<?php 
    //includes
	$userID = $_POST["users_idNum"];
	$userID = intval($userID);
	$complaint = $_POST["complaints_complaint"];
	$ses_id = session_id();
	include("../../database/connect.php");
	$userInfo = mysql_query("SELECT * FROM users WHERE idNum='$userID'");
	$info = mysql_fetch_array($userInfo);
	$complaintInfo = mysql_query("SELECT * FROM brun WHERE idNum='$userID' and sessionID='$ses_id'");
	$row = mysql_fetch_array($complaintInfo);
    
    // from first form
	$ageLine = ($info['sex'] == 'male' ? "בן " : "בת ") . $info['age'] . ", ";
	
    //from second form
    $DurationUnits = $row['durationUnits'];
    switch ($DurationUnits)
    {
        case 'days':
            $DurationUnits = "ימים";
            continue;
        case 'weeks':
            $DurationUnits = "שבועות";
            continue;
        case 'months':
            $DurationUnits = "חודשים";
            continue;
        default:
            continue;
    }
    
    $timeSick = $row['duration'] . " " . $DurationUnits;
	$started = $row['started'];
    
	//$has_nausea = $row['has_nausea'];
    //$has_dizzi = $row['has_dizzi'];
    //$has_burn = $row['has_burn'];
    //$food_related = $row['food_related'];
    //$has_hiccup = $row['has_hiccup'];
    //$has_fever = $row['has_fever'];
    //$fever_behavior = $row['fever_behavior'];
    //$has_shiver = $row['has_shiver'];
    //$took_medication = $row['took_medication'];
    //$had_before = $row['had_before'];  
    //$other_person = $row['other_person'];
    
	
    $History = $row['has_nausea'] ? "תחושת בחילה" : "ללא בחילות ";

    $History .= $row['has_dizzi'] ? "תחושת סחרחורת " : "ללא סחרחורות ";
    
    $History .= $row['has_burn'] ? "צרבות" : "ללא צרבות ";
    
    $History .= $row['food_related'] ? "עם קשר לאוכל" : "ללא קשר לאוכל ";
    
    $History .= $row['has_hiccup'] ? "מלווה בשיהוקים חזקים " : "ללא שיהוקים ";
    
    $History .= $row['$has_fever'] ? "חום" : "ללא חום ";
    
    $History .= $row['$has_shiver'] ? "תחושת צמרמורות/רעידות" : "ללא צמרמורות/רעידות ";
    
    //Standatd
    $History = $row['took_medication'] ? "" : "לא ";
    $History .= "לקח תרופות בסמוך לתחילת התסמינים, ";
    $History .= $row['had_before'] ? "" : "לא ";
    $History .= "חווה אירוע כזה בעבר, ";
    $History .= $row['other_person'] ? "" : "לא ";
    $History .= "מציין אדם עם תסמינים דומים בקרבתו";
    

//--------------------Output--------------------------------
?>

<a class="entry"> <?php echo "הקאות מזה " . $timeSick . " של " .$content ?></a> 
<a class="entry"> <?php echo " " . $frequency ." פעמים ב". $frequencyUnits ?></a>
<a class="entry"> <?php echo $History?></a>
